n = int(input())
nums = [0,2,6,36]
if n <= 3:
    print(nums[n])
MODE = int(1e9+7)
def product(m1,m2):
    a = len(m1)
    b = len(m2)
    c = len(m2[0])
    ans = [[0 for _ in range(c)] for _ in range(a)]
    for i in range(a):
        for j in range(b):
            for k in range(c):
                ans[i][k] += m1[i][j] * m2[j][k]
                ans[i][k] %= MODE
    return ans
def pow_mat(f0,f1,nn):
    base = [[1,0],[0,1]]
    t = [[1,1],[1,0]]
    while nn:
        if nn & 1:
            base = product(base, t)
        t = product(t,t)
        nn >>= 1
    return product(base, [[f1],[f0]])

e3 = pow_mat(1,1,n)[1][0] + 1
e2 = pow_mat(0,1,n)[1][0] - 1
print()